define(function (require, exports, module) {
    return function (jQuery) {
        (function ($) {
            /*seajs-content-start*/

            var mposframe = function () {
                return {
                    restrict: 'E',
                    scope: {
                        pagedata: '='
                    },
                    replace: true,
                    template: '<div class="frame {{pagedata.class}}"><ng:include src="pagedata.url"></ng:include></div>',
                    link: function ($scope, iElement, iAttrs) {
                        $(iElement).height($(window).height() - 50);
                    },
                    controller: function ($scope) {
                        $scope.changeurl = function (name, url) {
                            $scope.pagedata.name = name;
                            $scope.pagedata.url = url;
                        }
                    }
                }
            };
            var startmenu = function () {
                return {
                    restrict: 'E',
                    scope: {
                        data: "=",
                        gopage: "&"
                    },
                    controller: function ($scope) {
                    },
                    link: function (scope, element, attrs) {
                        var $width = $(window).width();
                        var count = scope.data.length;
                        scope.liwidth = { width: ($width / count).toFixed(2) - 2 };

                        $(".manage_menu").hover(function () {
                            $(".menu_list").animate({ top: 103, opacity: 100 }, 200);
                        }, function () {
                            $(".menu_list").animate({ top: 0, opacity: 0 }, 200);
                        });

                        var mouseevent = function (class1, class2) {
                            $("." + class1 + " > li").live('mouseenter', function () {
                                var index = $("." + class1 + " > li").index(this);
                                $("." + class2 + " > li").eq(index).addClass('current');
                            }).live('mouseleave', function () {
                                $("." + class2 + " > li").removeClass('current');
                            });
                        };
                        mouseevent("menu_main", "menu_list");
                        mouseevent("menu_list", "menu_main");
                    },
                    template: '<div class="manage_menu">\n    <ul class="menu_main">\n        <li ng-repeat="item in data" ng-style="liwidth"><div class="icon \' + {{item.classname}} + \'"></div><h3>{{item.title}}</h3></li>\n    </ul>\n    <ul class="menu_list">\n        <li ng-repeat="item in data" ng-style="liwidth">\n            <ul class="pagelist">\n                <li ng-repeat="pageitem in item.contents">\n                    <a ng-click="gopage({name:pageitem.pagename, url:pageitem.pageurl})"><span class="icon \' + {{pageitem.pageicon}} + \'"></span><span>{{pageitem.pagename}}</span></a>\n                </li>\n            </ul>\n        </li>\n    </ul>\n</div>'
                };
            };
            var navigation = function () {
                return {
                    restrict: 'E',
                    scope: {
                        data: "="
                    },
                    controller: function ($scope) {
                        $scope.lastitem = $scope.data[0];
                        $scope.selectnav = function (item) {
                            $scope.lastitem.class = "";
                            item.class = "current";
                            $scope.lastitem = item;
                        };
                        $scope.addnav = function () {
                            $scope.lastitem.class = "";
                            $scope.data.push({ name: "导航页", url: "modules/StartPage.html", class: "current" });
                            $scope.lastitem = $scope.data[$scope.data.length - 1];
                        };
                        $scope.closenav = function (index) {
                            if ($scope.data.length == 1) {
                                $scope.data[0] = { name: "导航页", url: "modules/StartPage.html", class: "current" };
                            }
                            else {
                                $scope.lastitem.class = "";
                                $scope.data.splice(index, 1);
                            }
                            $scope.lastitem = $scope.data[0];
                            $scope.data[0].class = "current";
                        }
                    },
                    link: function (scope, element, attrs) {
                    },
                    template: '<div class="navigation">\n    <div class="navigationmain">\n        <ul>\n            <li ng-click="selectnav(navitem)" ng-class="navitem.class" ng-repeat="navitem in data">\n                <a><span>{{navitem.name}}</span><i title="关闭" ng-click="closenav($index)"></i></a></li>\n        </ul>\n        \n    </div>\n</div>\n<a class="addnav" ng-click="addnav()"></a>'
                }
            };
            var jqgrid = function () {
                require('jqgrid-ui-css');
                //require('jqgrid-ui-bootstrap-css');
                //require('jqgrid-ui-bootstrap-ui-css');
                require('jqgrid')($);
                return {
                    restrict: 'E',
                    scope: {
                        options: '=',
                        id: "@"
                    },
                    replace: true,
                    template: '<div style=" position: relative">\n    <table></table>\n    <!--<div class="nodata"></div>-->\n    <div></div>\n    <div id=\'isloading\' class="loading" style="display: none">\n        <div>\n            <img src="images/loading.gif" />\n            <h2>数据加载中...</h2>\n        </div>\n    </div>\n</div>',
                    link: function ($scope, iElement, iAttrs) {

                        $scope.reloadgrid = function () {
                            iElement.children().remove();
                            iElement.append("<table id='" + iAttrs.id + "table\'></table>\n<!--<div class=\'nodata\'></div>-->\n<div></div>\n<div id=\"isloading\" class=\"loading\" style=\"display: none\">\n   <div>\n       <img src=\"images/loading.gif\" />\n       <h2>数据加载中...</h2>\n   </div>\n</div>");

                            //                            var autoWidth = $scope.options.autoWidth;
                            //                            if(typeof autoWidth =="undefined"){
                            //                                autoWidth = true;
                            //                            }
                            var griddata = angular.copy($scope.options.griddata);
                            if (typeof ($scope.options.shrinkToFit) == 'undefined') {
                                $scope.options.shrinkToFit = false;
                            }
                            $scope.options.obj = iElement.children("table").jqGrid({
                                datatype: "local",
                                shrinkToFit: $scope.options.shrinkToFit,
                                //                                autoWidth: autoWidth,
                                scrollrows: true,
                                autoHeight: true,
                                colNames: griddata.colnames,
                                colModel: griddata.colmodel,
                                rowNum: 300,
                                onSelectRow: $scope.options.onSelectRow,
                                onSortCol: $scope.options.onSortCol
                            });
                            for (var i = 0; i <= griddata.data.length; i++) {
                                $scope.options.obj.addRowData(i + 1, griddata.data[i]);
                            }

                            $scope.options.obj.jqGrid("setFrozenColumns");

                            /*无数据水印*/
                            if (griddata.data.length > 0) {
                                //iElement.children('.nodata').hide();
                            }
                            else {
                                //iElement.children('.nodata').show();
                            }
                            //自适应宽高
                            if ($scope.options.gridresize) {
                                $scope.options.gridresize($scope.options.obj);
                            }
                        };
                        $scope.reloadgrid();
                        $scope.$watch('options.griddata', function (newValue, oldValue) {
                            if (newValue && newValue != oldValue) {
                                $scope.reloadgrid();
                            }
                        }, true);

//                        $scope.$watch('options.isloading', function (newValue, oldValue) {
//                            if(newValue == true){
//                                iElement.find('#isloading').show()
//                            }
//                            else{
//                                iElement.find('#isloading').hide()
//                            }
//
//                        }, true);

                        $(window).resize(function () {
                            $(window).unbind("onresize");
                            $scope.options.gridresize($scope.options.obj);
                            $(window).bind("onresize", this);
                        })
                    },
                    controller: function ($scope) {
                    }
                }
            };
            var artdialog = function () {
                require('artDialog-skin');
                require('artDialog')($);
                require('artDialog-plugins')($);

                return {
                    restrict: 'E',
                    replace: true,
                    transclude: true,
                    scope: {
                        option: "="
                    },
                    template: '<div class="c_dialog"><div ng-transclude></div></div>',
                    link: function ($scope, iElement, iAttrs) {
                        if($scope.option.lock != false){
                            $scope.option.lock = true
                        }
                        $scope.option.show = function () {
                            $scope.option.obj = art.dialog({
                                title: $scope.option.title,
                                modal: true,
                                button: $scope.option.button,
                                content: iElement.get(0),
                                padding: '0px',
                                okValue: $scope.option.okValue || "确定",
                                lock: $scope.option.lock,
                                cancelValue: $scope.option.cancelValue || "取消",
                                ok: function () { var res = $scope.option.ok(); if (res == false) { return false } $scope.$apply() },
                                cancel: function () { $scope.option.cancel(); $scope.$apply() }
                            });
                        }
                    },
                    controller: function ($scope) {
                    }
                }
            };
            var ztree = function () {
                require('ztreestyle');
                require('ztree-core')($);
                require('ztree-excheck')($);
                require('ztree-exhide')($);

                var ztree = $.fn.zTree.init;
                var filtertree = {
                    SearchTree: function (key, ztree, recordHidden) {
                        var allnodes = ztree.transformToArray(ztree.getNodes());
                        var nodelist = ztree.getNodesByParamFuzzy("name", key, null);
                        var hiddennodes = ztree.getNodesByParam("isHidden", true);
                        ztree.showNodes(hiddennodes);
                        if (key) {
                            ztree.hideNodes(allnodes);
                            if (nodelist != null) {

                                //add children nodes of matched nodes
                                var childrenList = [];
                                for (var i in nodelist) {
                                    var children = nodelist[i].children;
                                    if (typeof (children) != "undefined" && children.length > 0) {
                                        childrenList = childrenList.concat(children);
                                    }
                                }
                                //add parents nodes of matched nodes
                                var parentsList = [];
                                for (var i in nodelist) {
                                    var parent = nodelist[i].getParentNode();
                                    while (parent) {
                                        parentsList.push(parent);
                                        parent = parent.getParentNode()
                                    }
                                }
                                ztree.showNodes(childrenList);
                                ztree.showNodes(parentsList);
                                ztree.showNodes(nodelist);

                                //                                for(var i=0, l=nodelist.length; i<l; i++) {
                                //                                    this.ShowListNode(nodelist[i], ztree);
                                //                                }
                            }
                        }
                        //记录树形隐藏的数据 
                        if (typeof (recordHidden) != "undefined" && recordHidden.length != 0) {
                            ztree.hideNodes(recordHidden);
                        }
                    },
                    ShowListNode: function (childnode, ztree) {

                        if (childnode.getParentNode() != null) {
                            this.ShowListNode(childnode.getParentNode(), ztree);
                        }
                        ztree.showNode(childnode);
                    }
                };
                return {
                    restrict: 'E',
                    scope: {
                        options: "=",
                        checkenable: "@",
                        id: "@"
                    },
                    replace: true,
                    template: '<ul class="ztree"></ul>',
                    link: function ($scope, iElement, iAttrs) {
                        if (!$scope.options.addDiyDom) {
                            $scope.options.addDiyDom = function (treeId, treeNode) {
                                return;
                            }
                        }
                        var setting = {
                            async: {
                                enable: true,
                                url: $scope.options.zreeURL
                            },
                            view: {
                                showIcon: true,
                                addDiyDom: $scope.options.addDiyDom
                            },

                            check: {
                                enable: true
                            },
                            callback: {
                                onClick: $scope.options.onclick,
                                onExpand: $scope.options.onExpand,
                                onAsyncSuccess: $scope.options.onAsyncSuccess
                            }
                        };
                        $scope.options.obj = ztree($(iElement), setting, $scope.options.data);
                        if ($scope.options.tofilter) {
                            $scope.options.tofilter = function (val) {
                                if (!val) {
                                    val = "";
                                }
                                //记录树形隐藏的数据 recordHidden 
                                filtertree.SearchTree(val, $scope.options.obj, $scope.options.recordHidden);
                            };
                        }

                        $scope.$watch(function () { return $scope.options.data }, function (newValue, oldValue) {
                            if (newValue && newValue.length != 0) {
                                if (!$scope.options.onclick) {
                                    $scope.options.onclick = function (event, treeId, treeNode, clickFlag) {
                                        return
                                    }
                                }
                                if (iAttrs.checkenable === "false") {
                                    setting.check.enable = false;
                                }
                                $scope.options.obj = ztree($(iElement), setting, $scope.options.data);
                                if ($scope.options.complate) {
                                    $scope.options.complate();
                                }
                            }
                        });
                        $scope.$watch(function () { return $scope.options.filter }, function (newValue, oldValue) {
                            if (typeof $scope.options.tofilter != 'function') {
                                if (!newValue) {
                                    newValue = "";
                                }
                                filtertree.SearchTree(newValue, $scope.options.obj);
                            }

                        });
                    },
                    controller: function ($scope) {
                    }
                }
            };

            var sortpage = function () {
                return {
                    restrict: 'E',
                    scope: {
                        sortpagedata: '='
                    },
                    replace: true,
                    template: '<div class="sortpage">\n    <span style="font-size: 12px; margin-left: 5px;">显示第<span ng-bind="sortpagedata.startline" style="margin: 0 5px; text-decoration: underline;"></span>至<span ng-bind="sortpagedata.endline" style="margin: 0 5px; text-decoration: underline;"></span>条</span>\n    <span style="font-size: 12px; margin-left: 5px;">共<span ng-bind="sortpagedata.datacount" style="margin: 0 5px; text-decoration: underline;"></span>条记录</span>\n    <a href="javascript:" title="第一页" ng-click="toFirstpage()"><span class="x18icon first"></span></a>\n    <a href="javascript:" title="上一页" ng-click="toToppage()"><span class="x18icon top"></span></a>\n    <span><input type="text" ng-model="sortpagedata.nowpage" ng-enter="topage()" style="width: 40px" /> / <span ng-bind="sortpagedata.totalpage"></span></span>\n    <a href="javascript:" title="下一页" ng-click="toNextpage()"><span class="x18icon next"></span></a>\n    <a href="javascript:" title="最后一页" ng-click="toLastpage()"><span class="x18icon last"></span></a>\n    <span style="font-size: 12px; margin-left: 5px;">每页: </span>\n    <select ng-model="sortpagedata.pagesize" ng-change="changePagesize()" ng-options="item for item in sortpagedata.pagelist">\n    </select>\n    <span style="font-size: 12px; margin-left: 5px;" title={{sortpagedata.totalcount}}>总记录数: </span><span ng-bind="sortpagedata.totalcount" style="margin-right: 20px; text-decoration: underline;"></span>\n</div>',
                    link: function ($scope, iElement, iAttrs) {
                    },
                    controller: function ($scope) {
                        $scope.toFirstpage = $scope.sortpagedata.toFirstpage;
                        $scope.toToppage = $scope.sortpagedata.toToppage;
                        $scope.toNextpage = $scope.sortpagedata.toNextpage;
                        $scope.toLastpage = $scope.sortpagedata.toLastpage;
                        $scope.changePagesize = $scope.sortpagedata.changePagesize;
                        $scope.topage = $scope.sortpagedata.topage;
                    }
                }
            };

            var dropdownlist = function () {
                return {
                    restrict: 'E',
                    scope: {
                        options: '=',
                        id:"@"
                    },
                    replace: true,
                    template: '<div class="dropdownlist">\n    <input readonly="readonly" type="text" ng-model="options.selectData.name"/>\n    <ul ng-show="options.show">\n        <li ng-repeat="item in options.ddldata" ng-click="selectValue(item)" data-value="{{item.id}}">{{item.name}}</li>\n    </ul>\n</div>',
                    link: function ($scope, iElement, iAttrs) {
                        $("#"+iAttrs.id).bind({
                            "mouseenter":function(){
                                //$(this).find("ul").show();
                                $scope.options.show = true;
                                $scope.$apply();
                            },
                            "mouseleave":function(){
                                $scope.options.show = false;
                                $scope.$apply();
                                //$(this).find("ul").hide();
                            }/*,
                            "click":function(event){
                                if (event.target.tagName == "LI") {
                                    $(this).find("input").val($(event.target).text()); //传具体的文字
                                    //        $(this).find("input").val($(event.target).attr("data-value"));  传属性值
                                }
                                $(this).find("ul").hide();
                            }*/
                        })
                    },
                    controller: function ($scope) {
                        $scope.selectValue = function (value) {
                            $scope.options.selectData = value;
                            $scope.options.show = false;
                        }
                    }
                }
            }

            var timepicker = function () {
                require('jquery-ui-timepicker-css');
                require('jquery-ui-timepicker')($);
                require('jquery-ui-timepicker-CN')($);
                return {
                    restrict: 'E',
                    scope: {
                        option: "="
                    },
                    replace: true,
                    template: '<input type="text"/>',
                    link: function ($scope, iElement, iAttrs) {
                        var config = $scope.option.config;
                        $scope.option.obj = $(iElement).datetimepicker(angular.extend({
                            dateFormat: 'yy-mm-dd',
                            timeFormat: 'hh:mm:ss',
                            onSelect: function (dateText, inst) {
                                $scope.$apply(function () {
                                    $scope.option.time = dateText;
                                });
                            }
                        }, config));
                        $scope.$watch('option.time', function (newValue, oldValue) {
                            if (newValue) {
                                $(iElement).datetimepicker('setDate', new Date(newValue));
                            }

                        });
                    },
                    controller: function ($scope) {
                    }
                }
            };
            var datepicker = function () {
                require('jquery-ui-timepicker-css');
                require('jquery-ui-timepicker')($);
                require('jquery-ui-timepicker-CN')($);
                return {
                    restrict: 'E',
                    scope: {
                        time: "="
                    },
                    replace: true,
                    template: '<input type="text"/>',
                    link: function ($scope, iElement, iAttrs) {
                        $(iElement).datepicker({
                            dateFormat: 'yy-mm-dd',
                            onSelect: function (dateText, inst) {
                                $scope.$apply(function () {
                                    $scope.time = dateText;
                                })
                            }
                        });
                        $scope.$watch('time', function (newValue, oldValue) {
                            $(iElement).datetimepicker('setDate', new Date($scope.time));
                        });
                    }
                }
            };
            var highcharts = function () {
                require('highcharts');
                require('highcharts-more');
                require('exporting');

                var chartOptions = {
                    chart: {
                        type: 'line'
                    },
                    title: {
                        text: 'chart title'
                    },
                    xAxis: {
                        categories: []
                    },
                    series: []
                };
                return {
                    restrict: 'E',
                    scope: {
                        options: "="
                    },
                    template: '<div style="position: relative">\n    <div class="hchart"></div>\n    <!--<div class="nodata"></div>-->\n</div>',
                    link: function ($scope, iElement, iAttrs) {
                        $scope.$watch('options.chartdata', function (newValue, oldValue) {
                            if (newValue) {
                                if ($scope.options.height) {
                                    iElement.find('.hchart').height($scope.options.height);
                                }
                                var ops = angular.extend(chartOptions, $scope.options.chartdata, {
                                    series: angular.copy($scope.options.chartdata.series)
                                });
                                iElement.find('.hchart').highcharts(ops,$scope.options.chartfn);
                                $scope.options.obj = iElement.find('.hchart').highcharts();
                            }
                        });
                        $scope.$watch('options.chartdata.series', function (newValue, oldValue) {
                            if (newValue) {
                                if ($scope.options.height) {
                                    iElement.find('.hchart').height($scope.options.height);
                                }
                                var ops = angular.extend(chartOptions, $scope.options.chartdata, {
                                    series: angular.copy($scope.options.chartdata.series)
                                });
                                iElement.find('.hchart').highcharts(ops,$scope.options.chartfn);
                                $scope.options.obj = iElement.find('.hchart').highcharts();
                            }
                        }, true);
                        $scope.$watch('options.chartdata.series', function (newValue, oldValue) {
                            if (newValue && newValue.length != 0) {
                                //iElement.find('.nodata').hide();
                            }
                            else {
                                //iElement.find('.nodata').show();
                            }
                        }, true)
                    },
                    controller: function ($scope) {
                    }
                }
            };

            var Echarts = function () {
                require('echarts');

                var chartOptions = {
                    chart: {
                        type: 'line'
                    },
                    title: {
                        text: 'chart title'
                    },
                    xAxis: {
                        categories: []
                    },
                    series: []
                };
                return {
                    restrict: 'E',
                    scope: {
                        options: "="
                    },
                    template: '<div style="position: relative">\n    <div class="hchart"></div>\n    <div class="nodata"></div>\n</div>',
                    link: function ($scope, iElement, iAttrs) {
                        $scope.$watch('options.chartdata', function (newValue, oldValue) {
                            if (newValue) {
                                if ($scope.options.height) {
                                    iElement.find('.hchart').height($scope.options.height);
                                }
                                var ops = angular.extend(chartOptions, $scope.options.chartdata, {
                                    series: angular.copy($scope.options.chartdata.series)
                                });
                                //$scope.options.obj = iElement.find('.hchart').echarts();
                                var theme= {};
                                $scope.options.obj = echarts.init(iElement.find('.hchart')[0]);
                                var option = $scope.options.chartdata;
                                $scope.options.obj.setOption(option);
                                window.addEventListener("resize", function () {

                                    $scope.options.obj.resize();

                                });
                                //window.onresize = $scope.options.obj.resize;
                            }
                        });
                        $scope.$watch('options.chartdata.series', function (newValue, oldValue) {
                            if (newValue) {
                                if ($scope.options.height) {
                                    iElement.find('.hchart').height($scope.options.height);
                                }
                                var ops = angular.extend(chartOptions, $scope.options.chartdata, {
                                    series: angular.copy($scope.options.chartdata.series)
                                });
                                //$scope.options.obj = iElement.find('.hchart').echarts();
                                var theme= {};
                                $scope.options.obj = echarts.init(iElement.find('.hchart')[0]);
                                var option = $scope.options.chartdata;
                                $scope.options.obj.setOption(option);
                                window.addEventListener("resize", function () {

                                    $scope.options.obj.resize();

                                });
                                //window.onresize = $scope.options.obj.resize;
                            }
                        }, true);
                        $scope.$watch('options.chartdata.series', function (newValue, oldValue) {
                            if (newValue && newValue.length != 0) {
                                iElement.find('.nodata').hide();
                            }
                            else {
                                iElement.find('.nodata').show();
                            }
                        }, true)
                    },
                    controller: function ($scope) {
                    }
                }
            };
            var multiselect = function () {
                require('jquery-multiselect-css');
                require('jquery-multiselect')($);
                return {
                    restrict: 'E',
                    scope: {
                        options: "="
                    },
                    replace: true,
                    template: '<span><select multiple="multiple" ng-model="selected"></select></span>',
                    //                    template : '<select ng-model="selected" ng-options="col.name for col in data" ng-multiple="true" multiple></select>',
                    link: function ($scope, iElement, iAttrs) {
                        $scope.$watch('options.data', function (newValue, oldValue) {
                            if (newValue) {
                                iElement.children().remove();
                                iElement.append('<select multiple="multiple" ng-model="selected"></select>');
                                $.each(newValue, function (index, row) {
                                    iElement.children("select").append("<option value='" + row.value + "'>" + row.name + "</option>");
                                });
                                iElement.children("select").multiselect({
                                    selectedList: 2
                                });
                                $scope.options.obj = iElement.children("select");
                            }
                        }, true)
                    },
                    controller: function ($scope) {
                    }
                }
            };
            var widget = function () {
                return {
                    restrict: 'E',
                    replace: true,
                    transclude: true,
                    scope: {
                        title: '='
                    },
                    template: '<div class="widget">\n    <div>\n        <div class="widgetheader">\n            {{title}}<a class="rtbtn max" ng-click="changesize()"><span></span></a>\n        </div>\n        <div class="widgetcontent" ng-transclude>\n        </div>\n    </div>\n</div>',
                    link: function ($scope, iElement, iAttrs) {
                        $scope.changesize = function () {
                            //                            iElement.css({border:"1px solid red"});
                        }
                    }
                }
            };
            var tabs = function () {
                return {
                    restrict: 'E',
                    replace: true,
                    transclude: true,
                    scope: {
                        options: '='
                    },
                    template: '<div class="tabs" ng-transclude></div>',
                    link: function ($scope, iElement, iAttrs) {
                        if($scope.options){
                            $scope.options.obj = iElement.tabs();
                        }
                        else{
                            iElement.tabs();
                        }
                    }
                }
            };
            var selectable = function () {
                return {
                    restrict: 'E',
                    replace: false,
                    link: function ($scope, iElement, iAttrs) {
                        iElement.selectable();
                    }

                }
            };
            var accordion = function () {
                return {
                    restrict: 'E',
                    replace: false,
                    link: function ($scope, iElement, iAttrs) {
                        iElement.accordion();
                    }

                }
            };
            var slider = function () {
                require('jquery-ui');
                return {
                    restrict: 'E',
                    replace: true,
                    scope: {
                        options: '='
                    },
                    template: '<div class="slider"></div>',
                    link: function ($scope, iElement, iAttrs) {
                        $scope.$watch('options.timelength', function (newValue, oldValue) {
                            iElement.slider({
                                max: newValue - 1,
                                min: 0,
                                step: 1,
                                value: 0,
                                change: function (event, ui) {
                                    $scope.options.changeTime(ui.value);
                                }
                            })
                        });
                    }
                }
            };
            var loading = function () {
                return {
                    restrict: 'E',
                    replace: true,
                    transclude: true,
                    scope: {
                        visiable: '='
                    },
                    template: '<div class="loading" ng-show="visiable"><div ng-transclude></div></div>',
                    link: function ($scope, iElement, iAttrs) {
                    }
                }
            };
            var ngEnter = function () {
                return function (scope, element, attrs) {
                    element.bind("keydown keypress", function (event) {
                        if (event.which === 13) {
                            scope.$apply(function () {
                                scope.$eval(attrs.ngEnter);
                            });
                            event.preventDefault();
                        }
                    });
                };
            };
            angular.module('mpos-directive', [])
                .directive('mainmenu', startmenu)
                .directive('navigation', navigation)
                .directive('mposframe', mposframe)
                .directive('jqgrid', jqgrid)
                .directive('sortpage', sortpage)
                .directive('artdialog', artdialog)
                .directive('ztree', ztree)
                .directive('highcharts', highcharts)
                .directive('echarts', Echarts)
                .directive('timepicker', timepicker)
                .directive('datepicker', datepicker)
                .directive('multiselect', multiselect)
                .directive('widget', widget)
                .directive('tabs', tabs)
                .directive('accordion', accordion)
                .directive('slider', slider)
                .directive('loading', loading)
                .directive('ngEnter', ngEnter)
                .directive('dropdownlist',dropdownlist)
            /*seajs-content-end*/
        })(jQuery);
    }
})

